Programming With QuickTime Sprites

| Previous | Chapter Contents | Chapter Top | Next |

Using Wired Sprites

The sprite media handler provides functions that allow your application to create and manipulate a wired sprite movie, with various types of user interactivity.

The following sections are illustrated with code from the sample program QTWiredSprites.c , which shows how to create a sample wired sprite movie containing one sprite track. (For a complete code listing of the sample program, see Appendix C.) The sample code creates a 320 by 240 pixel wired movie with one sprite track that contains six sprites, two of which are penguins and four of which are buttons. Figure 2-5 shows two penguins at the outset of the movie, with the buttons invisible.

Figure 5 Two penguins from a sample program

Initially, the four buttons in the wired movie are invisible. When the mouse enters or "rolls over" a button, it appears, as shown in Figure 2-6 .

Figure 6 Two penguins and four buttons, indicating various directions in the movie

When the mouse is clicked inside a button, its images change to its "pressed" image. When the mouse is released, its image is changed back to its "unpressed" image. If the mouse is released inside the button, it triggers an action. The buttons perform the following set of actions:

Actions of the First Penguin

Actions of the Second Penguin

Creating a Wired Sprite Movie


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |